#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include <QtNetwork/QNetworkReply>
#include <QtNetwork/QNetworkRequest>
#include <QtNetwork/QNetworkAccessManager>
#include "dialog.h"
#include <qtablewidget.h>
QT_BEGIN_NAMESPACE
namespace Ui { class MainWindow; }
QT_END_NAMESPACE

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    MainWindow(QWidget *parent = nullptr);
    ~MainWindow();

private slots:
    void on_queryStock_clicked();

    void on_pushButton_2_clicked();

    void on_queryBig_3_clicked();

    void on_pushButton_clicked();

    void on_queryHis_clicked();

    void on_tableWidget_itemClicked(QTableWidgetItem *item);

    void on_queryBig_5_clicked();

    void UpDateTime();

    void on_queryBig_6_clicked();
    void autoUpdate(); //自动更新表格中存在的股票信息
    void on_queryBig_7_clicked();

private:
    Ui::MainWindow *ui;
    QByteArray Http_Get(QString url);
    void AddDataToTable(QStringList datalist,QString StockCode);
    void LogStr(QString qstr);
    void InitUI();
    QDialog* selfUpDlg;
    QStringList CustStock;
    void GetDataByStockCode(QString code);
    QString GetMidStr(QString src,QString headStr,QString backStr); //文本取中间文本
    void DelStockByCode(QString StockCode); //从表格中删除股票

    QTimer* qtimer;
    QTimer* antoTimer;
};
#endif // MAINWINDOW_H
